$(function(){
    $(".isActivity").click(function(){
    /*
     *表单提交
     */
        var uri ='/admin/Goods/isActivity';
        var id = $(this).attr('data-id');
        var status = $(this).attr('data-status');
        var data = {goods_id:id,goods_status:status};
        ajaxPost(uri, $(".isActivity"), data, function(r){
            $(".isActivity").removeAttr("disabled");
            location.href = r.url;
        });
    });
    $(".goods_recom").click(function(){
        /*
         *表单提交
         */
        var uri ='/admin/Goods/goods_recom';
        var id = $(this).attr('data-id');
        var status = $(this).attr('data-status');
        var data = {goods_id:id,goods_status:status};
        ajaxPost(uri, $(".goods_recom"), data, function(r){
            $(".goods_recom").removeAttr("disabled");
            location.href = r.url;
        });
    });
    $('.del_goods').click(function(){
        var msg = "您确定要删除该信息吗？\n\n请确认！";
        if (confirm(msg)==true){
            var uri =$(this).attr('data-url');
            var id = $(this).attr('data-id');
            var data = {goods_id:id};
            ajaxPost(uri, $(".del_goods"), data, function(r){
                $(".del_goods").removeAttr("disabled");
                location.href = r.url;
            });
        }else{
            return false;
        }
    });

});